{% extends "../base.html" %}

{% block title %}Participants{% endblock %}
{% block header %}Participants{% endblock %}

{% block content %}
    <a href="/projects">Projects</a>/
    <a href="/editProjectForm?projectId={{ projectId }}">Project</a>
    
    <table cellpadding="0" cellspacing="0" class="list">
    	<thead>
    		<th>Name</th>
    		<th>Delete</th>
    	</thead>
    {% for participant in participants %}
        <form id="delete-form-{{ participant.key ]}" method="post" action="/deleteParticipant">
            <input type="hidden" name="participantId" value="{{ participant.key }}"></input>
        </form>
        <tr> 
            <td><a href="/editParticipant?participantId={{ participant.key }}">{{ participant.user.nickname }}</a></td>
            <td>
                 <a href="#" onclick="document.getElementById('delete-form-{{ participant..key }}').submit()">Delete</a>
            </td> 
        </tr>
    {% endfor %}
    </table>
    
    <a href="/createParticipant?projectId={{ projectId }}">Add participant</a>
{% endblock %}
